import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘柄华
 * Date: 2022-06-12
 * Time: 20:16
 */

/*
*   mkdir
* */
public class Test03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = sc.nextInt();
            String[] path = new String[n];
            for (int i = 0; i < n; i++) {
                path[i] = sc.next();
            }
            Arrays.sort(path);

            boolean[] flg = new boolean[n];
            for (int i = 0; i < n-1; i++) {
                if(path[i].equals(path[i+1]) || (path[i+1].contains(path[i]) && path[i+1].charAt(path[i].length()) == '/')){
                    flg[i] = true;
                }
            }
            for (int i = 0; i < n; i++) {
                if(!flg[i]){
                    System.out.println("mkdir -p"+path[i]);
                }
            }
            System.out.println();
        }

    }
}
